<nav id="sidebar" class="{{if $.Site.Params.showVisitedLinks }}showVisitedLinks{{end}}">

  {{ $currentNode := . }}
  {{ $showvisitedlinks := .Site.Params.showVisitedLinks }}
    <div id="header-wrapper">
      <!-- <div id="header">
        {{ partial "logo.html" . }}
      </div> -->
      {{if not .Site.Params.disableSearch}}
          {{ partial "search.html" . }}
      {{end}}
    </div>
  
      <div class="highlightable">
      <div class="leftMenu">
      <ul class="topics">
  
          {{if eq .Site.Params.ordersectionsby "title"}}  
            {{range .Site.Home.Sections.ByTitle}}
            {{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks}}
            {{end}}
          {{else}}
            {{range .Site.Home.Sections.ByWeight}}
            {{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks}}
            {{end}}
          {{end}} 
      </ul>
  
      {{ $disableShortcutsTitle := .Site.Params.DisableShortcutsTitle}}
      {{with .Site.Menus.shortcuts}}
        <section id="shortcuts">
          <h3>{{ if not $disableShortcutsTitle}}{{ T "Shortcuts-Title"}}{{ end }}</h3>
          <ul>
            {{ range sort . "Weight"}}
                <li> 
                    {{.Pre}}<a class="padding" href="{{.URL | absLangURL }}">{{safeHTML .Name}}</a>{{.Post}}
                </li>
            {{end}}
          </ul>
        </section>
      {{end}}
    </div>
      <!-- {{ partial "language.html" . }} -->
  
      <!-- download button -->
      <!-- <hr /> -->
      {{ if eq .Lang "en"}}
        <a class="padding" href="{{"https://shardingsphere.apache.org/pdf/shardingsphere_docs_en.pdf" | absURL}}">
          <!--i class="fa fa-fw fa-file-pdf-o" ></i>&nbsp;-->Download PDF<!--&nbsp;&nbsp;&nbsp; is a placeholder-->
      {{ else }}  
        <a class="padding" href="{{"https://shardingsphere.apache.org/pdf/shardingsphere_docs_cn.pdf" | absURL}}">
          <!-- class="fa fa-fw fa-file-pdf-o" ></i>&nbsp;-->下载PDF文档<!--&nbsp;&nbsp; &nbsp; is a placeholder -->
      {{end}}
      </a>
      
      <section id="footer">
        {{ partial "menu-footer.html" . }}
      </section>
    </div>
  </nav>
  
  <!-- templates -->
  {{ define "section-tree-nav" }}
  {{ $showvisitedlinks := .showvisitedlinks }}
  {{ $currentNode := .currentnode }}
   {{with .sect}}
    {{if .IsSection}}
      {{safeHTML .Params.head}}
      <li data-nav-id="{{.URL}}" title="{{.Title}}" class="dd-item 
          {{if .IsAncestor $currentNode }}parent{{end}}
          {{if eq .UniqueID $currentNode.UniqueID}}active{{end}}
          {{if .Params.alwaysopen}}parent{{end}}
          ">
        {{ $numberOfPages := (add (len .Pages) (len .Sections)) }}      
        <a href="{{.RelPermalink}}">
           <i class="collapse" style="display:inline; font-family:'courier';">
           {{ if ne $numberOfPages 0 }}
               <svg  class="icon icon-down" 
                style="display: {{if .IsAncestor $currentNode }}inline-block;{{else}}none;{{end}}"
                viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"   width="20" height="20" fill="#777">
                <path d="M500.8 604.778667L267.306667 371.392l-45.226667 45.269333 278.741333 278.613334 278.485334-278.613334-45.248-45.248z" p-id="5376" ></path>
              </svg>
              <svg  class="icon icon-right" 
                style="display: {{if .IsAncestor $currentNode }}none;{{else}}inline-block;{{end}}"
                viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"  width="20" height="20" fill="#777">
                <path d="M593.450667 512.128L360.064 278.613333l45.290667-45.226666 278.613333 278.762666L405.333333 790.613333l-45.226666-45.269333z" p-id="5605" ></path>
              </svg>
            {{else}}
              <svg  viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
            {{end}}
            </i>
            {{safeHTML .Params.Pre}}{{or .Params.menuTitle .LinkTitle .Title}}{{safeHTML .Params.Post}}
            {{ if $showvisitedlinks}}
              <i class="fa fa-check read-icon"></i>
            {{ end }}
        </a>
        
        {{ if ne $numberOfPages 0 }}
          <ul>
            {{ $currentNode.Scratch.Set "pages" .Pages }}
            {{ if .Sections}}
              {{ $currentNode.Scratch.Set "pages" (.Pages | union .Sections) }}
            {{end}}
            {{ $pages := ($currentNode.Scratch.Get "pages") }}
            
          {{if eq .Site.Params.ordersectionsby "title"}}  
            {{ range $pages.ByTitle }}
              {{ if and .Params.hidden (not $.showhidden) }} 
              {{else}}
              {{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks }}
              {{end}}
            {{ end }}
          {{else}}
            {{ range $pages.ByWeight }}
              {{ if and .Params.hidden (not $.showhidden) }} 
              {{else}}
              {{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks }}
              {{end}}
            {{ end }}
          {{end}}
          </ul>
        {{ end }}        
      </li>
    {{else}}
      {{ if not .Params.Hidden }}
        <li data-nav-id="{{.URL}}" title="{{.Title}}" class="dd-item {{if eq .UniqueID $currentNode.UniqueID}}active{{end}}">
          <a href="{{ .RelPermalink}}">
            <svg  viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
          {{safeHTML .Params.Pre}}{{or .Params.menuTitle .LinkTitle .Title}}{{safeHTML .Params.Post}}
          {{ if $showvisitedlinks}}<i class="fa fa-check read-icon"></i>{{end}}
          </a>
      </li>
       {{ end }}
    {{end}}
   {{ end }}
  {{ end }}
  
  